home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #
- #
- PATH=$PATH:/usr/sbin:/usr/bin:/bin:/usr/local/bin
- umask 022
- HOST=`uname -n`
- export PATH
- USER=${USER:-$LOGNAME}
-
- if [ "$1" != "-install" ]; then
- (cat <<EOF
-
- Binary distribution of Sendmail 8.7.3 for Linux
- ===============================================
-
-
- Edit this file first to insure the binaries are installed where
- you want them.
-
- *** NO GUARANTEE IS MADE THAT THIS WON'T OVERRIDE EXISTING PROGRAMS
- - PLEASE DON'T JUST RUN THIS UNTIL YOU ARE SURE IT DOES WHAT YOU
- WANT.***
-
- NOTE: the sendmail binary expects to find it's sendmail.cf
- file in the /etc/ directory - all other file positions are
- defined inside sendmail.cf
-
- This will install files with the following file permissions:
-
- -rwsr-x--x 1 root root 267268 /usr/sbin/sendmail
- -rwx--x--x 1 root root 50180 /usr/sbin/makemap
- -rwxr-x--x 1 root root 17335 /usr/sbin/mailstats
- -rwx------ 1 root root 17124 /etc/sendmail.cf
- -rwxr-xr-x 1 root root 72044 /usr/local/etc/smrsh
-
- Also, sendmail will be linked to the following:
-
- lrwxrwxrwx 1 root root /usr/sbin/newaliases -> sendmail
- lrwxrwxrwx 1 root root /usr/sbin/mailq -> sendmail
-
- The following packages are also installed. If you don't want some
- parts of it, either edit this file, or delete them afterwards.
-
- -rwsr-xr-x 1 root root 25907 /bin/mail.local
- -rwxr-xr-x 1 root root 29700 /usr/local/bin/formail
- -rwxr-sr-x 1 root mail 13316 /usr/local/bin/lockfile
- -rwsr-sr-x 1 root mail 54276 /usr/local/bin/procmail
-
- Also man pages are installed under /usr/local/man.
-
- The following files/directories are also required - as their position depends
- on how you define them in the sendmail.cf file, these positions are just a
- suggestion, you will have to install them yourself.
-
- -rwx------ 1 root root 3152 Oct 22 04:03 /usr/lib/sendmail.hf
- -rw-r--r-- 1 root root 534 Jan 30 14:31 /etc/aliases
-
- And the directories:
-
- drwx------ 2 root mail 1024 Feb 26 14:38 /var/spool/mqueue/
- drwx-wx--x 2 root mail 1024 Feb 26 14:44 /var/spool/mail/
-
- Note: This works for me using procmail (setuid root, setgid mail) as my
- local delivery agent. As you can see, this is a very strong directory
- protection. If it doesn't work for your local delivery agent (perhaps
- mail.local), try opening it up a little at a time until it does - some say
- mail spools should be set "1777" - that's world-writable but "sticky" (like
- /tmp). I don't know why, but I don't like that idea ;-) All I know is the
- above arrangement works 100% for me.
-
- After completing the installation, you will need to decide how you
- want sendmail to run - either as a daemon (started at boot-time) or via
- inetd.
-
- Type "$0 -install" to actually do the installation.
-
- EOF
- )|more
- else
-
- if [ "$USER" != "root" ]; then
- cat<<EOF
- Sorry, installation must be done by root
- EOF
- exit
- fi
-
- if [ ! -f "./${HOST}.cf" ]; then
- cat<<EOF
-
- You will need to read the documentation and create a sendmail
- configuration file called "./${HOST}.cf" in this directory before
- running this script.
-
- EOF
- exit
- fi
-
- echo ""
- echo -n "Actually begin installation now? (Y/[N]): "
- read ans
- if [ "$ans" = "" -o "$ans" = "N" -o "$ans" = "n" ]; then
- echo "OK, exiting without installing..."
- exit
- fi
-
- mkdir /usr/sbin /usr/local /usr/local/etc /usr/local/bin /usr/adm/sm.bin > /dev/null 2>&1 || true
-
- cd bin
-
- cp sendmail /usr/sbin/sendmail
- chown root.root /usr/sbin/sendmail
- chmod 4711 /usr/sbin/sendmail
- rm -f /usr/sbin/mailq /usr/sbin/newaliases
- ln -s /usr/sbin/sendmail /usr/sbin/mailq
- ln -s /usr/sbin/sendmail /usr/sbin/newaliases
- cp ../${HOST}.cf /etc/sendmail.cf
- chmod 700 /etc/sendmail.cf
- cp makemap /usr/sbin/makemap
- chmod 0755 /usr/sbin/makemap
- cp mailstats /usr/sbin/mailstats
- chmod 711 /usr/sbin/mailstats
- cp smrsh /usr/local/etc/smrsh
- chmod 111 /usr/local/etc/smrsh
-
- echo "installed sendmail..."
-
- type procmail > /dev/null 2>&1
- status=$?
- if [ "$status" != "0" ]; then
- cp procmail formail lockfile /usr/local/bin/
- chown root.mail /usr/local/bin/procmail /usr/local/bin/formail /usr/local/bin/lockfile
- chmod 6755 /usr/local/bin/procmail
- chmod 2755 /usr/local/bin/lockfile
- echo "installed procmail/lockfile/formail in /usr/local/bin/ ..."
- fi
-
-
- type mail.local > /dev/null 2>&1
- status=$?
- if [ "$status" != "0" ]; then
- cp mail.local /bin/mail.local
- chown root.mail /bin/mail.local
- chmod 4751 /bin/mail.local
- echo "installed /bin/mail.local ..."
- fi
-
- cd ..
-
- touch /etc/sendmail.st
- if [ ! -r /var/spool/mail ]; then
- mkdir /var/spool/mail
- chown root.mail /var/spool/mail
- chmod 0711 /var/spool/mail
- echo "created /var/spool/mail directory ..."
- fi
-
- if [ ! -r /var/spool/mqueue ]; then
- mkdir /var/spool/mqueue
- chown root.mail /var/spool/mqueue
- chmod 0700 /var/spool/mqueue
- echo "created /var/spool/mqueue directory ..."
- fi
-
- cp sendmail.hf /usr/lib/sendmail.hf
- echo "installed /usr/lib/sendail.hf..."
-
- if [ ! -r /etc/aliases ]; then
- cp aliases /etc/aliases
- echo "installed generic /etc/aliases..."
- fi
-
- cd man
- mkdir /usr/local/man /usr/local/man/man1 /usr/local/man/man5 /usr/local/man/man8 > /dev/null 2>&1 || true
-
- umask 033
- cp *.8 /usr/local/man/man8/
- cp *.5 /usr/local/man/man5/
- cp *.1 /usr/local/man/man1/
- echo "installed man pages."
- fi
-
- cat<<EOF
-
- Installation complete.
-
- You will now need to set up your system so that sendmail runs as a daemon
- (either via inetd or at boot-time)
-
- EOF
-